﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Trackr.DataAccess
{
	public class FakeGenerator
	{
		private static Random _rand = new Random(1);

		public static int GetRandomNumber()
		{
			return _rand.Next();
		}
		public static int GetRandomNumber(int min, int max)
		{
			return _rand.Next(min, max);
		}
		public static string GetRandomText(int wordCount = 15)
		{
			string text = "Bacon ipsum dolor sit amet beef ribs aliqua proident pork loin id short loin doner corned beef est. Biltong enim cillum salami. Pariatur commodo ut, bresaola ground round do ex minim chuck ham cillum bacon ea. Ground round beef sunt, pariatur turkey adipisicing velit pancetta leberkas venison. Turducken sunt consequat pancetta occaecat pork chop cupidatat eu incididunt kielbasa. Capicola sed nisi fugiat anim. Shankle proident velit exercitation. Turducken dolore sirloin anim, labore nostrud ham hock do doner bresaola. Laborum chicken reprehenderit spare ribs ea in flank biltong sirloin ullamco culpa sed consectetur cow leberkas. Irure tri-tip commodo ham dolore cupidatat. Pork loin tail magna hamburger ham hock frankfurter beef ground round shank voluptate. Ut prosciutto velit duis filet mignon, consectetur tail pancetta doner. Cillum venison sirloin, ground round reprehenderit ad pork chop id est qui pork belly. Ball tip elit ground round non short loin culpa magna eiusmod. Do sunt flank, sint cow boudin eiusmod chicken consequat short loin. Ham biltong et, boudin elit fugiat doner. Sirloin flank elit ad veniam culpa. Drumstick commodo tail filet mignon. Est commodo bresaola, andouille aliquip boudin nostrud pork belly cillum cupidatat duis culpa doner tri-tip. Beef ribs t-bone jerky ut commodo non bresaola excepteur shankle consectetur. Esse aute in voluptate aliqua turkey sed shoulder qui enim quis consectetur. Prosciutto dolore ut sirloin tri-tip hamburger cupidatat chuck turducken short loin tenderloin cow ea pastrami. Drumstick shoulder culpa in ullamco meatloaf in t-bone laboris corned beef brisket minim duis pancetta. Qui adipisicing swine, corned beef laboris fugiat frankfurter ex tempor dolor ut laborum bresaola turkey nulla. Tongue velit cow aliqua sed jowl dolore in boudin flank est beef capicola. In brisket ad id exercitation short loin, cow proident doner est mollit culpa quis jowl ea. Consectetur flank pariatur beef, sunt filet mignon id exercitation jowl aute. Pork loin sed irure et adipisicing, hamburger beef ribs.";
			var words = text.Split(' ');
			StringBuilder outString = new StringBuilder();
			for (int i = 0; i <= wordCount; i++)
			{
				outString.Append(GetRandomItemFromArray(words));
				outString.Append(" ");
			}
			return outString.ToString();
		}

		public static DateTime GetRandomDate()
		{
			return DateTime.Now.AddDays(GetRandomNumber(-50, 50));
		}
		public static T GetRandomItemFromArray<T>(T[] objArray)
		{
			return objArray[_rand.Next(0, objArray.Length)];
		}
	}
}

